import request from "@/utils/request";
import type { AxiosPromise } from "axios";

export interface CodeInfo {
  id: string;
  bizName: string;
  bizValue: string;
  bizType: string;
  status: string;
  remark: string;
}
//获取码表数据
export const _getAllSystemCode = async (): AxiosPromise<CodeInfo[]> => {
  return request({
    url: '/system-code/query-all-system-code',
    method: 'GET',
  });
}
//获取码表数据
export const _getSystemCodeList = async (): AxiosPromise<CodeInfo[]> => {
  return request({
    url: '/system-code/query-system-code-list',
    method: 'GET',
  });
}
export const _getSystemCodeById = async (id: string): AxiosPromise<CodeInfo> => {
  return request({
    url: '/system-code/query-system-code-byId',
    method: 'GET',
    params: {
      codeId: id
    }
  });
}
export const _saveSystemCode = async (data: CodeInfo): AxiosPromise<CodeInfo> => {
  return request({
    url: '/system-code/insert',
    method: 'POST',
    data: data
  });
}
export const _updateSystemCode = async (data: CodeInfo): AxiosPromise<CodeInfo> => {
  return request({
    url: '/system-code/modify',
    method: 'POST',
    data: data
  });
}
